<template>
    <component :is="tabComponent"></component>
    <button @click="changeHandle"></button>
</template>
<script>
import ComponentA from './ComponentA.vue'
import ComponentB from './ComponentB.vue'
export default{
    data(){
        return{
            tabComponent:"ComponentA"
        }
    },
    components:{
        ComponentA,
        ComponentB
    },
    methods:{
        changeHandle(){
            this.tabComponent = this.tabComponent == "ComponentA" ? "ComponentB" : "ComponentA"
        }
    }      
}
</script>